﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace School.Controls
{
    public partial class Search : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["type"]))
                    rbtn_FindItem.SelectedIndex = int.Parse(Request.QueryString["type"]);
            }
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/WebPages/Search.aspx?type=" + rbtn_FindItem.SelectedValue + "&key=" + search_box.Text.Trim());
        }
    }
}